home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextDeveloper / Headers / netware / nwapi.h next >
C/C++ Source or Header  |  1995-02-06  |  15KB  |  527 lines

  1. /*
  2. @(#)nwapi.h    1.3 92/02/1316:29:43 92/02/1316:30:15
  3. */
  4. /*
  5. (C) Unpublished Copyright of Novell, Inc.  All Rights Reserved.
  6.  
  7. No part of this file may be duplicated, revised, translated, localized or modified
  8. in any manner or compiled, linked or uploaded or downloaded to or from any
  9. computer system without the prior written consent of Novell, Inc.
  10. */
  11.  
  12. /*
  13.     Author:    Scott Harrison
  14. */
  15. /*
  16.  *
  17.  *    This is a header file to be included by the application program 
  18.  *
  19.  */
  20.  
  21. #ifndef _api_h_
  22. #define _api_h_
  23.  
  24.  
  25.  
  26. /*    Define general types. */
  27. typedef    unsigned long        uint32;    /* 32-bit unsigned type */
  28. typedef    unsigned short        uint16;    /* 16-bit unsigned type */
  29. typedef    unsigned char        uint8;    /* 8-bit unsigned type */     
  30.  
  31. typedef    long                int32;    /* 32-bit signed type */
  32. typedef    short                int16;    /* 16-bit signed type */
  33. typedef char                int8;    /* 8-bit signed type */
  34.  
  35. typedef short                NWBoolean_ts;
  36.  
  37. typedef void    opaque_t;
  38.  
  39. typedef int32    ccode_t;
  40.  
  41. #define     SUCCESS        0
  42.  
  43. #ifndef     TRUE
  44. #define        TRUE        1
  45. #define        FALSE        0
  46. #endif
  47.  
  48. /*******************************************************************
  49.  *
  50.  * Information pertaining to the accounting API calls
  51.  *
  52.  *******************************************************************/
  53. #define        NWMAX_OBJECT_NAME_LENGTH        48
  54. #define        NWMAX_NUMBER_OF_HOLDS            32
  55. #define        NWMAX_COMMENT_LENGTH            48
  56.  
  57. /* the following definitions are for use with NWSubmitAccountNote */
  58. #define     NWAN_CONNECT_TIME                1
  59. #define        NWAN_DISK_STORAGE                2
  60. #define        NWAN_LOG_IN                        3
  61. #define        NWAN_LOG_OUT                    4
  62. #define        NWAN_ACCOUNT_LOCKED                5
  63. #define        NWAN_SERVER_TIME_MODIFIED        6
  64.  
  65. typedef struct {
  66.     uint32    objectID;
  67.     int32    holdAmount;
  68. } NWHoldInfo_t;
  69.  
  70.  
  71. /*******************************************************************
  72.  *
  73.  * Information pertaining to the bindery API calls
  74.  *
  75.  *******************************************************************/
  76.  /* object and property states */
  77. #define        NWBF_STATIC            0x00    
  78. #define        NWBF_DYNAMIC        0x01    
  79.  
  80. /* property types */
  81. #define        NWBF_ITEM            0x00
  82. #define        NWBF_SET            0x02
  83.  
  84. #define        NWMAX_SEGMENT_DATA_LENGTH        128
  85. #define        NWMAX_OBJECT_NAME_LENGTH        48
  86. #define        NWMAX_PROPERTY_NAME_LENGTH        16    
  87. #define        NWMAX_MEMBER_NAME_LENGTH        48    
  88. #define        NWMAX_PASSWORD_LENGTH            16
  89. #define        NWMAX_PROPERTY_VALUE_LENGTH     128    
  90.  
  91. #define     NWBS_ANY_READ                    0x00
  92. #define        NWBS_LOGGED_READ                0x01
  93. #define        NWBS_OBJECT_READ                0x02
  94. #define        NWBS_SUPER_READ                    0x03
  95. #define        NWBS_BINDERY_READ                0x04
  96. #define        NWBS_ANY_WRITE                    0x00
  97. #define        NWBS_LOGGED_WRITE                0x10
  98. #define        NWBS_OBJECT_WRITE                0x20
  99. #define        NWBS_SUPER_WRITE                0x30
  100. #define        NWBS_BINDERY_WRITE                0x40
  101.  
  102. #define        NWOT_WILD                        0xFFFF
  103. #define        NWOT_UNKNOWN                    0x0000
  104. #define        NWOT_USER                        0x0001
  105. #define        NWOT_USER_GROUP                    0x0002
  106. #define        NWOT_PRINT_QUEUE                0x0003
  107. #define        NWOT_FILE_SERVER                0x0004
  108. #define        NWOT_JOB_SERVER                    0x0005
  109. #define        NWOT_GATEWAY                    0x0006
  110. #define        NWOT_PRINT_SERVER                0x0007
  111. #define        NWOT_ARCHIVE_QUEUE                0x0008
  112. #define        NWOT_ARCHIVE_SERVER                0x0009
  113. #define        NWOT_JOB_QUEUE                    0x000A
  114. #define        NWOT_ADMINISTRATION                0x000B
  115. #define        NWOT_NAS_SNA_GATEWAY            0x0021
  116. #define        NWOT_REMOTE_BRIDGE_SERVER        0x0024
  117. #define        NWOT_TIME_SYNCHRONIZATION_SERVER 0x002D
  118. #define        NWOT_ARCHIVE_SERVER_DYNAMIC_SAP    0x002E
  119. #define        NWOT_ADVERTISING_PRINT_SERVER    0x0047
  120. #define        NWOT_BTRIEVE_VAP                0x0050
  121. #define        NWOT_PRINT_QUEUE_USER            0x0053
  122. #define        NWOT_NVT_SERVER                    0x009E
  123.  
  124. typedef struct {
  125.     char        objectName[ NWMAX_OBJECT_NAME_LENGTH ];
  126.     uint32        objectID;
  127.     uint16        objectType;
  128.     uint8        objectState;
  129.     uint8        objectSecurity;
  130. } NWObjectInfo_t;
  131.  
  132. typedef struct {
  133.     char        propertyName[ NWMAX_PROPERTY_NAME_LENGTH ];
  134.     uint8        propertyStateAndType;
  135.     uint8        propertySecurity;
  136.     uint8        propertyHasAValue;
  137. } NWPropertyInfo_t;
  138.  
  139.  
  140. /******************************************************************* 
  141. * Information pertaining to the connection API calls 
  142. *
  143. * *******************************************************************/ 
  144. #define     NWMAX_OBJECT_NAME_LENGTH        48    
  145. #define        NWMAX_LOGIN_TIME_LENGTH            7 
  146. #define        NWMAX_INTERNET_ADDRESS_LENGTH    12 
  147. #define        NWMAX_KEYED_PASSWORD_LENGTH        8
  148.  
  149.  
  150.  
  151. /********************************************************************
  152.  *
  153.  * Information pertaining to the file system API calls 
  154.  *
  155.  ********************************************************************/
  156. #define        NWMAX_DIR_PATH_LENGTH            255
  157. #define        NWMAX_FILE_HANDLE_SIZE            6
  158. #define        NWMAX_DIR_NAME_LENGTH            16    
  159. #define        NWMAX_FILE_NAME_LENGTH            16    
  160. #define        NWMAX_VOLUME_NAME_LENGTH        16    
  161. #define        NWMAX_NS_NAME                    16
  162. #define        NWMAX_DS_NAME                    16
  163. #define        NWMAX_NUM_NS                    10 
  164. #define        NWMAX_NUM_DS                    10
  165. #define        NWMAX_NS_COUNT                    10 
  166. #define        NWMAX_USER_RESTRICTIONS            12
  167.  
  168. /* file attributes */
  169. #define        NWFA_NORMAL         0x00000000L
  170. #define        NWFA_READ_ONLY      0x00000001L
  171. #define        NWFA_HIDDEN         0x00000002L
  172. #define        NWFA_SYSTEM         0x00000004L
  173. #define        NWFA_EXECUTE_ONLY   0x00000008L
  174. #define        NWFA_NEED_ARCHIVE   0x00000020L
  175. #define        NWFA_SHARABLE       0x00000080L
  176. #define        NWFA_TRANSACTIONAL  0x00001000L
  177. #define        NWFA_INDEXED        0x00002000L
  178. #define        NWFA_READ_AUDIT     0x00004000L
  179. #define        NWFA_WRITE_AUDIT    0x00008000L
  180. #define        NWFA_PURGE          0x00010000L
  181. #define        NWFA_RENAME_INHIBIT 0x00020000L
  182. #define        NWFA_DELETE_INHIBIT 0x00040000L
  183. #define        NWFA_COPY_INHIBIT     0x00080000L
  184.  
  185. /* Trustee Access Rights in a 286 Network directory */
  186. #define        NWTA_NONE             ((uint8)0x00)
  187. #define        NWTA_READ             ((uint8)0x01)
  188. #define        NWTA_WRITE            ((uint8)0x02)
  189. #define        NWTA_OPEN             ((uint8)0x04)
  190. #define        NWTA_CREATE           ((uint8)0x08)
  191. #define        NWTA_DELETE           ((uint8)0x10)
  192. #define        NWTA_OWNERSHIP        ((uint8)0x20)
  193. #define        NWTA_SEARCH           ((uint8)0x40)
  194. #define        NWTA_MODIFY           ((uint8)0x80)
  195. #define        NWTA_ALL              ((uint8)0xFF)
  196.  
  197. /* trustee rights and inherited rights for 386 */
  198. #define        NWTR_NONE           0x0000
  199. #define        NWTR_READ           0x0001
  200. #define        NWTR_WRITE          0x0002
  201. /*                                0x0004 ignore this bit */
  202. #define        NWTR_CREATE         0x0008
  203. #define        NWTR_ERASE          0x0010
  204. #define        NWTR_ACCESS         0x0020
  205. #define        NWTR_FILE_SCAN      0x0040
  206. #define        NWTR_MODIFY         0x0080
  207. #define        NWTR_SUPERVISOR     0x0100
  208. #define        NWTR_NORMAL         0x00FF 
  209. #define        NWTR_ALL            0x01FF
  210.  
  211. /* search attributes */
  212. #define        NWSA_NONE                0x00
  213. #define        NWSA_HIDDEN                0x02
  214. #define        NWSA_SYSTEM                0x04
  215. #define        NWSA_BOTH                0x06
  216. #define        NWSA_FILES_ONLY            0x20  /* NOT for 286 */
  217. #define        NWSA_DIRECTORIES_ONLY    0x10  /* NOT for 286 */
  218.  
  219. /* desired open access rights */
  220. #define        NWOR_READ           0x01
  221. #define        NWOR_WRITE          0x02
  222. #define        NWOR_DENY_READ      0x04
  223. #define        NWOR_DENY_WRITE     0x08
  224. #define        NWOR_COMPATIBILITY    0x10
  225. #define        NWOR_SYNC_MODE        0x40
  226.  
  227. /* change attributes used in conjunction with set dir/file info */
  228. #define        NWCA_NAME                            0x0001    
  229. #define        NWCA_ATTRIBUTES                        0x0002
  230. #define        NWCA_CREATE_DATE_AND_TIME            0x000C
  231. #define        NWCA_OWNER_ID                        0x0010
  232. #define        NWCA_LAST_ARCHIVED_DATE_AND_TIME    0x0060
  233. #define        NWCA_LAST_ARCHIVED_ID                0x0080
  234. #define        NWCA_LAST_MODIFY_DATE_AND_TIME        0x0300
  235. #define        NWCA_LAST_MODIFY_ID                    0x0400
  236. #define        NWCA_LAST_ACCESSED_DATE                0x0800
  237. #define        NWCA_INHERITED_RIGHTS_MASK            0x1000
  238. #define        NWCA_DIR_RESTRICTION                0x2000
  239.  
  240.  
  241. typedef        uint8    NWDirHandle_ts;
  242. typedef     uint8    NWFileHandle_ta[ NWMAX_FILE_HANDLE_SIZE ];
  243.  
  244. typedef struct {
  245.     NWDirHandle_ts    dirHandle;
  246.     uint16            serverConnID;
  247.     char            *pathName;
  248. } NWPath_t;
  249.  
  250. typedef struct {
  251.     uint32    totalBlocks;
  252.     uint32    availableBlocks;
  253.     uint32    purgableBlocks;
  254.     uint32    notYetPurgableBlocks;
  255.     uint32    totalDirEntries;
  256.     uint32    availDirEntries;
  257.     uint32    maxDirEntriesUsed;
  258.     uint16    volNum;
  259.     uint16    sectorsPerBlock;
  260.     uint8    isHashed;
  261.     uint8    isCached;
  262.     uint8    isRemovable;
  263.     uint8    isMounted;
  264.     char    volName[ NWMAX_VOLUME_NAME_LENGTH ];
  265. } NWVolUsage_t;
  266.  
  267. typedef struct {
  268.     uint32    attributes;
  269.     uint32    creationDateAndTime;
  270.     uint32    ownerID;
  271.     uint32    archiveDateAndTime;
  272.     uint32    archiverID;
  273.     uint32    lastModifyDateAndTime;
  274.     uint32    dirRestriction;
  275.     uint16    inheritedRightsMask;
  276.     uint8    nameSpaceID;
  277.     char    entryName[ NWMAX_DIR_NAME_LENGTH ];
  278. } NWDirEntryInfo_t;
  279.  
  280. typedef struct {
  281.     uint32    attributes;
  282.     uint32    creationDateAndTime;
  283.     uint32    ownerID;
  284.     uint32    archiveDateAndTime;
  285.     uint32    archiverID;
  286.     uint32    updateDateAndTime;
  287.     uint32    updatorID;
  288.     uint32    fileSize;
  289.     uint32    lastAccessDateAndTime;
  290.     uint16    inheritedRightsMask;
  291.     uint8    nameSpaceID;
  292.     char    entryName[ NWMAX_FILE_NAME_LENGTH ];
  293. } NWFileEntryInfo_t;
  294.  
  295. typedef struct {
  296.     uint32    trusteeID;
  297.     uint16    trusteeRights;
  298. } NWTrusteeRights_t;
  299.  
  300. typedef struct {
  301.     uint16    level;
  302.     uint32    maxBlocks;
  303.     uint32    availableBlocks;
  304. } NWDirRestriction_t;
  305.  
  306. typedef struct {
  307.     uint32    objectID;
  308.     uint32    restriction;
  309. } NWUserRestriction_t;
  310.  
  311. typedef struct
  312. {
  313.    uint32   deletedDateAndTime;
  314.    uint32   deleterID;
  315.    uint32   attributes;
  316.    uint32   creationDateAndTime;
  317.    uint32   ownerID;
  318.    uint32   archiveDateAndTime;
  319.    uint32   archiverID;
  320.    uint32   updateDateAndTime;
  321.    uint32   updatorID;
  322.    uint32   fileSize;
  323.    uint32   inheritedRightsMask;
  324.    uint32   lastAccessDateAndTime;
  325.    uint8    nameSpaceID;
  326.    char     fileName[NWMAX_NS_NAME];
  327. } NWSalvageableInfo_t;
  328.  
  329. typedef struct {
  330.     uint8                definedDataStreams;
  331.     char                dataStreamName[NWMAX_NUM_DS] [NWMAX_DS_NAME];
  332. } NWDataStreamInfo_t;
  333.     
  334. typedef struct {
  335.     uint8                definedNameSpaces;
  336.     char                nameSpaceName[NWMAX_NUM_NS] [NWMAX_NS_NAME];
  337.     uint8                nameSpaceDataStreams;
  338.     NWDataStreamInfo_t    dataStream[NWMAX_NUM_NS];
  339.     uint8                loadedNSCount;
  340.     uint8                loadedNS[NWMAX_NS_COUNT];
  341.     uint8                volumesNSCount;
  342.     uint8                volumesNS[NWMAX_NS_COUNT];
  343.     uint8                volumesDSCount;
  344.     uint8                volumesDS[NWMAX_NS_COUNT];
  345. } NWNameSpaceInfo_t;
  346.  
  347.  
  348. /*******************************************************************
  349.  *
  350.  * Information pertaining to the path services API calls
  351.  *
  352.  *******************************************************************/
  353.  
  354.  
  355.  
  356. /*******************************************************************
  357.  *
  358.  * Information pertaining to the queue management API calls
  359.  *
  360.  *******************************************************************/
  361. #define        NWMAX_QUEUE_NAME_LENGTH                    48
  362. #define        NWMAX_JOB_STRUCT_SIZE                    256
  363. #define        NWMAX_QUEUE_SUBDIR_LENGTH                119
  364. #define        NWMAX_NUMBER_OF_JOB_NUMBERS                250
  365. #define        NWMAX_NUMBER_OF_SERVER_CONN_NUMBERS        25
  366. #define        NWMAX_NUMBER_OF_SERVER_OBJECT_IDS        25
  367. #define        NWMAX_SERVER_STATUS_RECORD_LENGTH        64
  368. #define        NWMAX_QUEUE_JOB_TIME_SIZE                6
  369. #define        NWMAX_JOB_FILE_NAME_LENGTH                14
  370. #define        NWMAX_JOB_DESCRIPTION_LENGTH            50
  371. #define        NWMAX_CLIENT_RECORD_LENGTH                152
  372. #define        NWMAX_FORM_NAME_LENGTH                    16
  373. #define        NWMAX_BANNER_NAME_FIELD_LENGTH            13
  374. #define        NWMAX_BANNER_FILE_FIELD_LENGTH            13
  375. #define        NWMAX_HEADER_FILE_NAME_LENGTH            14
  376. #define        NWMAX_JOB_DIR_PATH_LENGTH                80    
  377.  
  378. /* the following are job control flags */
  379. #define        NWCF_OPERATOR_HOLD            0x80
  380. #define        NWCF_USER_HOLD                0x40
  381. #define        NWCF_ENTRY_OPEN                0x20
  382. #define        NWCF_SERVICE_RESTART        0x10
  383. #define        NWCF_SERVICE_AUTO_START        0x08
  384.  
  385. /* the following are control flags used with NWPrintRecord_t */
  386. #define        NWPCF_SUPPRESS_FF            0x0008
  387. #define        NWPCF_NOTIFY_USER            0x0010
  388. #define        NWPCF_TEXT_MODE                0x0040
  389. #define        NWPCF_PRINT_BANNER            0x0080
  390.  
  391. /* the queue status flags are used with NWSetQueueCurrentStatus */
  392. #define        NWQS_NO_SERVER_RESTRICTIONS                0x00
  393. #define        NWQS_NO_MORE_JOBS                        0x01
  394. #define        NWQS_NO_MORE_SERVER_ATTACHMENTS            0x02
  395. #define        NWQS_SERVERS_DISABLED                    0x08
  396.  
  397. typedef unsigned char NWClientRecord_ta[ NWMAX_CLIENT_RECORD_LENGTH ];
  398.  
  399. typedef struct {
  400.     uint8    versionNumber;
  401.     uint8    tabSize;
  402.     uint16    numCopies;
  403.     uint16    controlFlags;
  404.     uint16    linesPerPage;
  405.     uint16    charsPerLine;
  406.     char    formName[ NWMAX_FORM_NAME_LENGTH ];
  407.     char    bannerNameField[ NWMAX_BANNER_NAME_FIELD_LENGTH ];
  408.     char    bannerFileField[ NWMAX_BANNER_FILE_FIELD_LENGTH ];
  409.     char    headerFileName[ NWMAX_HEADER_FILE_NAME_LENGTH ];
  410.     char    directoryPath[ NWMAX_JOB_DIR_PATH_LENGTH ];
  411. } NWPrintRecord_t;
  412.  
  413. typedef struct {
  414.     uint8                clientStation;
  415.     uint8                clientTask;
  416.     uint32                clientID;
  417.     uint32                targetServerID;
  418.     uint8                targetExecutionTime[ NWMAX_QUEUE_JOB_TIME_SIZE];
  419.     uint8                jobEntryTime[ NWMAX_QUEUE_JOB_TIME_SIZE ];
  420.     uint16                jobNumber;
  421.     uint16                jobType;
  422.     uint8                jobPosition;
  423.     uint8                jobControlFlags;
  424.     uint8                jobFileName[ NWMAX_JOB_FILE_NAME_LENGTH ];
  425.     NWFileHandle_ta        jobFileHandle;
  426.     uint8                servicingServerStation;
  427.     uint8                servicingServerTaskNumber;
  428.     uint32                servicingServerIDNumber;
  429.     uint8                jobDescription[ NWMAX_JOB_DESCRIPTION_LENGTH ];
  430.     NWClientRecord_ta    queueRecord;
  431. } NWQueueJobStruct_t;
  432.  
  433.  
  434. /*******************************************************************
  435.  *
  436.  * Information pertaining to the server platform API calls
  437.  *
  438.  *******************************************************************/
  439. #define        NWMAX_OBJECT_NAME_LENGTH        48    
  440. #define        NWMAX_COMPANY_NAME_LENGTH        80 
  441. #define        NWMAX_DESCRIPTION_LENGTH        80
  442. #define        NWMAX_DATE_LENGTH                24
  443. #define        NWMAX_COPYRIGHT_NOTICE_LENGTH    80
  444. #define        NWMAX_SERVER_NAME_LENGTH        48
  445. #define        NWMAX_CONNECTION_LIST_LENGTH    50
  446.  
  447. typedef struct {
  448.     uint16    majorVersion;
  449.     uint16    minorVersion;
  450.     uint16    revision;
  451.     uint16    SFTLevel;
  452.     uint16    TTSLevel;
  453.     uint16    accountingVersion;
  454.     uint16    VAPVersion;
  455.     uint16    queueingVersion;
  456.     uint16    printServerVersion;
  457.     uint16    virtualConsoleVersion;
  458.     uint16    securityRestrictionLevel;
  459.     uint16    internetBridgeSupport;
  460.     uint16    maxClientConnSupported;
  461.     uint16    clientConnInUse;
  462.     uint16    peakClientConnUsed;
  463.     uint16    maxVolumes;
  464.     char    serverName[ NWMAX_SERVER_NAME_LENGTH ];
  465. } NWServerPlatformInfo_t;
  466.  
  467. typedef struct {
  468.     uint8    year;
  469.     uint8    month;
  470.     uint8    day;
  471.     uint8    hour;
  472.     uint8    minute;
  473.     uint8    second;
  474.     uint8    dayOfWeek;    /* 0 means sunday */
  475. } NWServerPlatformDateAndTime_t;
  476.  
  477. typedef struct {    /* For 286 core printer use only */
  478.     uint8    printerHalted;
  479.     uint8    printerOffLine;
  480.     uint8    currentFormType;
  481.     uint8    redirectedPrinter;
  482. } NWPrinterInfo_t;
  483.  
  484. typedef struct {
  485.     char    companyName[ NWMAX_COMPANY_NAME_LENGTH ];
  486.     char    revisionDescription[ NWMAX_DESCRIPTION_LENGTH ];
  487.     char    revisionDate[ NWMAX_DATE_LENGTH ];
  488.     char    copyrightNotice[ NWMAX_COPYRIGHT_NOTICE_LENGTH ];
  489. } NWDescriptionStrings_t;
  490.  
  491.  
  492. /*******************************************************************
  493.  *
  494.  * Information pertaining to the synchronization platform API calls
  495.  *
  496.  *******************************************************************/
  497. #define        NWMAX_LOGICAL_RECORD_NAME_LENGTH     80
  498. #define        NWMAX_SEMAPHORE_NAME_LENGTH         127
  499.  
  500. /* file lock log flags */
  501. #define        NWFL_LOG_ONLY                    0x00
  502. #define        NWFL_LOG_AND_LOCK                0x01
  503.  
  504. /* physical and logical record log flags */
  505. #define        NWPL_LOG_ONLY                    0x00
  506. #define        NWPL_LOG_AND_LOCK_EXCLUSIVE        0x01
  507. #define        NWPL_LOG_AND_LOCK_SHAREABLE        0x03
  508.  
  509. /* logical and physical lock set flags */
  510. #define        NWLS_EXCLUSIVE                    0x00
  511. #define        NWLS_SHAREABLE                    0x02
  512.  
  513.  
  514. /*******************************************************************
  515.  *
  516.  * Information pertaining to the transaction tracking platform API calls
  517.  *
  518.  *******************************************************************/
  519. /* currently no data */
  520.  
  521.  
  522.  
  523.  
  524. #endif
  525.  
  526.